LIB = libOnvif.a
SRC = ${wildcard *.c}
OBJ = ${patsubst %.c, %.o, $(SRC)}
CFLAGS = -g -Wall -I../../inc -I../../inc/LibCommon

ifeq ($(BOARD), X86)
CFLAGS += -D BOARD_X86
CC = gcc
else
CC = aarch64-linux-gnu-gcc
endif

$(LIB):$(OBJ)
	ar -cr $(LIB) $(OBJ)
	
ifeq ($(BOARD), X86)
	cp -f $(LIB) ../../lib/x86_64
else
	cp -f $(LIB) ../../lib/arm64-v8a
endif

$(OBJ):%.o : %.c
	$(CC) $(CFLAGS) -c $^ -o $@ 

.PHONY:clean

clean:
	rm -f *.o $(LIB)

